package gameBao

type FleeStatus int

const (
	StatusNone    = iota //无
	StatusBetting        //下注时间
	StatusBalance        //结算
)

const (
	GameBettingPush = 400 //下注推送
	GameStatusPush  = 401 //游戏状态推送
	GameBureauPush  = 402 //局数推送
	GameRoomPush    = 403 //房间的信息推送
	GameKillPush    = 404 //房间被杀推送
	GameResultPush  = 405 //本人结果推送
	GameOutPush     = 444 //退出游戏

)

func GameBettingPushData(roomID, myRoomID uint, user any, num int64) any {
	return map[string]any{
		"type": GameBettingPush,
		"data": map[string]any{
			"roomID":        myRoomID,
			"changeRoomID":  roomID,
			"user":          user,
			"changeRoomNum": num,
		},
		"pushRouter": "GameMessagePush",
	}
}

func GameStatusPushData(status FleeStatus, times int, kills []uint) any {
	return map[string]any{
		"type": GameStatusPush,
		"data": map[string]any{
			"status": status,
			"times":  times,
			"kills":  kills,
		},
		"pushRouter": "GameMessagePush",
	}
}

func GameBureauPushData(rounds int64) any {
	return map[string]any{
		"type": GameBureauPush,
		"data": map[string]any{
			"rounds": rounds,
		},
		"pushRouter": "GameMessagePush",
	}
}

func GameRoomPushData(room any) any {
	return map[string]any{
		"type":       GameRoomPush,
		"data":       room,
		"pushRouter": "GameMessagePush",
	}
}

func GameKillPushData(kill []uint) any {
	return map[string]any{
		"type":       GameKillPush,
		"data":       kill,
		"pushRouter": "GameMessagePush",
	}
}

func GameResultPushData(isKill, isDecline bool, returnNum, reward int64) any {
	return map[string]any{
		"type": GameResultPush,
		"data": map[string]any{
			"isKill":    isKill,
			"isDecline": isDecline,
			"returnNum": returnNum,
			"reward":    reward,
		},
		"pushRouter": "GameMessagePush",
	}
}
func GameOutPushData() any {
	return map[string]any{
		"type":       GameOutPush,
		"data":       nil,
		"pushRouter": "GameMessagePush",
	}
}
